package file;

public class Test4 {
    public static void main(String[] args) {
        int d = 0;
        System.out.println(doll(20,0,0,0));
    }
    public static int doll(int a,int b,int c,int d){
        if (a <= 0){
            return d;
        }else {
            a--;
            d++;
            b++;
            c++;
            if (b == 2){
                a++;
                b = 0;
            }
            if (c == 3){
                a++;
                c = 0;
            }
            return doll(a, b, c, d);
        }
    }
}
